﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Linq;

namespace LINQToolKit.Configuration
{
    public sealed class ProviderConfiguration : TypeConfiguration
    {
        public TypeConfiguration Translator { get; set; }
        public TypeConfiguration Processor { get; set; }

        protected override void Initialize(XElement element)
        {
            base.Initialize(element);
            
            var processor = element.Element("processor");

            if (processor != null)
            {
                this.Processor = new TypeConfiguration();
                this.Processor.InitializeFromElement(processor);
            }

            var transElement = element.Element("translator");

            if (transElement != null)
            {
                this.Translator = new TypeConfiguration();
                this.Translator.InitializeFromElement(transElement);
            }
        }
    }
}
